<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <body>

        <ui:composition template="./TemplatePrincipal.xhtml">

            <ui:define name="top">

            </ui:define>

            <ui:define name="left">

            </ui:define>

            <ui:define name="content">
                <f:view>
                    <h:form>
                        <p:growl id="n"/>
                        <h1><p:outputLabel value="Create/Edit"/></h1>
                        <p:panelGrid columns="2">
                            <p:outputLabel value="Meter:" for="meter" />
                            <p:inputText id="meter" value="#{terrainBean.tarrain.meter}" title="Meter" />
                            <p:outputLabel value="TomasdeAgua:" for="tomasdeAgua" />
                            <p:inputText id="tomasdeAgua" value="#{terrainBean.tarrain.tomasdeAgua}" title="TomasdeAgua" />
                            <p:outputLabel value="IdUser:" for="idUser" />
                            <p:selectOneMenu id="idUser" value="#{terrainBean.userSelect}" panelStyle="width:160px"  effect="fade" var="p" style="width:160px"  
                                             filter="true" filterMatchMode="startsWith"
                                             required="true" requiredMessage="The Perfile field is required.">
                                <!-- TODO: update below reference to list of available items-->
                                <f:selectItem itemLabel="Select One" itemValue=""/> 
                                <f:selectItems value="#{terrainBean.listUser}" var="h" itemLabel="#{h.name}"/>
                                <p:column> 
                                    #{p.name}
                                </p:column>  

                            </p:selectOneMenu>
                            <p:commandButton value="Aceptar" action="TerrainConfirm" update="n" actionListener="#{terrainBean.prepararUser}"/>
                            <p:commandButton value="Cancelar" action="TerrainFacelets" update="n" immediate="true"/>
                        </p:panelGrid>
                    </h:form>
                </f:view>

            </ui:define>

            <ui:define name="bottom">
               
            </ui:define>

        </ui:composition>

    </body>
</html>
